# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=ruby-ruby-nmap
_pkgname=ruby-nmap
pkgver=1.0.3
pkgrel=2
pkgdesc='A Ruby interface to Nmap, the exploration tool and security / port scanner.'
arch=('any')
license=('custom:unknown')
depends=('ruby' 'ruby-nokogiri' 'ruby-rprogram' 'nmap')
makedepends=('ruby-rdoc')
url='https://rubygems.org/gems/ruby-nmap'
source=("https://rubygems.org/downloads/$_pkgname-$pkgver.gem")
sha512sums=('779fec7d41d53edf573f84d56d1ab5f8170d47214ef4dde9ac04c60e79d4e8cb5c54dba2c19ea37b7672fc70b1248c54b3eeed9f96cc92b1d08f3e2c1f20458d')
noextract=("$_pkgname-$pkgver.gem")

package() {
  _gemdir=$(ruby -e 'puts Gem.default_dir')

  if [[ $CARCH == arm* ]] ; then
    gem install --no-user-install --ignore-dependencies --no-rdoc --no-ri \
      -n "$pkgdir/usr/bin" -i "$pkgdir$_gemdir" "$_pkgname-$pkgver.gem"
  else
    gem install --no-user-install --ignore-dependencies -i "$pkgdir$_gemdir" \
      -n "$pkgdir/usr/bin" "$_pkgname-$pkgver.gem"
  fi
}

